using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using SCS.DAL.Mapping;
using SCS.Common.Models;

namespace SCS.DAL
{
    public partial class SCSContext : DbContext
    {
        static SCSContext()
        {
            Database.SetInitializer<SCSContext>(null);
        }

        public SCSContext()
            : base("Name=SCSContext")
        {
        }

        public DbSet<Class> Classes { get; set; }
        public DbSet<ClassInSchoolYear> ClassInSchoolYears { get; set; }
        public DbSet<CommentInClass> CommentInClasses { get; set; }
        public DbSet<CommonComment> CommonComments { get; set; }
        public DbSet<Grade> Grades { get; set; }
        public DbSet<GradeType> GradeTypes { get; set; }
        public DbSet<Learner> Learners { get; set; }
        public DbSet<MembershipRole> MembershipRoles { get; set; }
        public DbSet<MembershipUser> MembershipUsers { get; set; }
        public DbSet<Parent> Parents { get; set; }
        public DbSet<PrivateMessage> PrivateMessages { get; set; }
        public DbSet<SchoolYear> SchoolYears { get; set; }
        public DbSet<Subject> Subjects { get; set; }
        public DbSet<Teacher> Teachers { get; set; }
        public DbSet<TeachingAssignment> TeachingAssignments { get; set; }
        public DbSet<Term> Terms { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ClassMap());
            modelBuilder.Configurations.Add(new ClassInSchoolYearMap());
            modelBuilder.Configurations.Add(new CommentInClassMap());
            modelBuilder.Configurations.Add(new CommonCommentMap());
            modelBuilder.Configurations.Add(new GradeMap());
            modelBuilder.Configurations.Add(new GradeTypeMap());
            modelBuilder.Configurations.Add(new LearnerMap());
            modelBuilder.Configurations.Add(new MembershipRoleMap());
            modelBuilder.Configurations.Add(new MembershipUserMap());
            modelBuilder.Configurations.Add(new ParentMap());
            modelBuilder.Configurations.Add(new PrivateMessageMap());
            modelBuilder.Configurations.Add(new SchoolYearMap());
            modelBuilder.Configurations.Add(new SubjectMap());
            modelBuilder.Configurations.Add(new TeacherMap());
            modelBuilder.Configurations.Add(new TeachingAssignmentMap());
            modelBuilder.Configurations.Add(new TermMap());
        }
    }
}
